<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/maintenance/maintenance.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/maintenance/maintenance.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'MaintenanceId',
                footer: "Foots",
                cnName: '维修管理',
                name: 'maintenance/maintenance',
                url: "/VehicleService/api/maintenance/",
                sortName: "CreateTime"
            });
            const editFormFields = ref({"MaintenanceTitle":"","MaintenanceType":"","CarLicense":"","MaintenanceMoney":"","MaintenanceManager":"","MaintenanceDescribe":"","MaintenanceDate":"","MaintenanceRemark":""});
            const editFormOptions = ref([[{"title":"维修标题","field":"MaintenanceTitle"}],
                              [{"dataKey":"维修类型","data":[],"title":"维修类型","field":"MaintenanceType","type":"select"}],
                              [{"dataKey":"车牌号下拉框","data":[],"title":"车牌号","field":"CarLicense","type":"select"}],
                              [{"title":"维修金额","field":"MaintenanceMoney","type":"decimal"}],
                              [{"dataKey":"员工姓名","data":[],"title":"维修负责人","field":"MaintenanceManager","type":"select"}],
                              [{"title":"维修描述","field":"MaintenanceDescribe"}],
                              [{"title":"维修日期","field":"MaintenanceDate","type":"datetime"}],
                              [{"title":"备注","field":"MaintenanceRemark"}]]);
            const searchFormFields = ref({"CarLicense":"","MaintenanceManager":"","MaintenanceDate":""});
            const searchFormOptions = ref([[{"dataKey":"车牌号下拉框","data":[],"title":"车牌号","field":"CarLicense","type":"select"},{"dataKey":"员工姓名","data":[],"title":"维修负责人","field":"MaintenanceManager","type":"select"},{"title":"维修日期","field":"MaintenanceDate","type":"datetime"}]]);
            const columns = ref([{field:'MaintenanceId',title:'维修记录Id',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'MaintenanceTitle',title:'维修标题',type:'string',width:110,align:'left',sort:true},
                       {field:'MaintenanceType',title:'维修类型',type:'int',bind:{ key:'维修类型',data:[]},width:110,align:'left'},
                       {field:'CarLicense',title:'车牌号',type:'string',bind:{ key:'车牌号下拉框',data:[]},width:110,align:'left'},
                       {field:'MaintenanceMoney',title:'维修金额',type:'decimal',width:110,align:'left'},
                       {field:'MaintenanceManager',title:'维修负责人',type:'string',bind:{ key:'员工姓名',data:[]},width:110,align:'left'},
                       {field:'MaintenanceDescribe',title:'维修描述',type:'string',width:110,align:'left'},
                       {field:'MaintenanceDate',title:'维修日期',type:'date',width:150,align:'left',sort:true},
                       {field:'MaintenanceRemark',title:'备注',type:'string',width:110,align:'left'},
                       {field:'IsDelete',title:'逻辑删除',type:'int',width:110,hidden:true,align:'left'},
                       {field:'CreateName',title:'创建人',type:'string',width:110,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',sort:true,width:150,align:'left',sort:true},
                       {field:'UpdateName',title:'修改人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'UpdateTime',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
